package com.ganbo.redpacket.exception;

import lombok.Data;

/**
 * 自定义异常
 * Created by gan on 2020/1/12 15:19.
 */
@Data
public class CustomException extends RuntimeException {
    private String code;

    public CustomException(String coce, String message) {
        super(message);
        this.code = coce;
    }


    public static CustomException build(ExceptionCode exceptionCode) {
        return new CustomException(exceptionCode.getCode(), exceptionCode.getMessage());
    }
}
